package com.eascs.web.demo.action;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.common.util.UuidUtil;
import com.eascs.site.view.ViewContext;
import com.eascs.web.demo.view.DefaultMasterViewController;

@Controller
public class ActionViewController extends DefaultMasterViewController {
	private final Logger logger = LoggerFactory.getLogger(ActionViewController.class);

	@RequestMapping(value = "/demo/action", method = RequestMethod.GET)
	public String formSubmit() {
		return "sample/action/index-message-jquery";
	}

	@RequestMapping(value = "/demo/action/get-html-fragment", method = RequestMethod.GET)
	public String getHtmlFragment(ActionForm actionForm) {
		ViewContext.put("uuid", UuidUtil.generateShortUuid(4));
		ViewContext.put("data", actionForm.getName());
		return "sample/action/html";
	}
}
